import React, { useEffect, useState } from 'react'
// 接收路由参数
import { useParams, useLocation } from 'react-router-dom';
import { look_list } from '../../../utils/Booking Management/api'


// 表格声明
interface DataType {
  id:string,
  name: string,
  jnumber: string,
  snumber: string,
  phone: string,
  ghks: string,
  money: string,
  over: string,
  house:string,
  jday: string
}
function Looklist() {
  // 接受动态路由传参 useParams
  // let {id} = useParams()
  // console.log(id);
  //接收动态路由参数 useLocation()
  let loction = useLocation()
  console.log(loction.state);
  const [data, setData] = useState<DataType>()
  // useEffect(()=>{
  //   look_list(id).then(({data})=>{
  //     console.log(data);      
  //     setData(data)
  //   })
  // },[])
  return (
    <div>
      <div className='title'>
        <h2>体检人员详情</h2>
      </div>
      <div className='card'>
        <div className='patientInformation'>患者信息</div>
        <div className='content'>
          <div>
            <span>患者姓名</span>&nbsp;:&nbsp;
            <span>{loction.state.name}</span>
          </div>
          <div>
            <span>就诊卡号</span>&nbsp;:&nbsp;
            <span>{loction.state.jnumber}</span>
          </div>
          <div>
            <span>证件类型</span>&nbsp;:&nbsp;
            <span>身份证</span>
          </div>
          <div>
            <span>证件号码</span>&nbsp;:&nbsp;
            <span>{loction.state.snumber}</span>
          </div>
          <div>
            <span>家庭住址</span>&nbsp;:&nbsp;
            <span>{loction.state.house}</span>
          </div>
          <div>
            <span>手机号</span>&nbsp;:&nbsp;
            <span>{loction.state.phone}</span>
          </div>
          <div>
            <span>状态</span>&nbsp;:&nbsp;
            <span>{loction.state.over}</span>
          </div>
          <div>
            <span>金额</span>&nbsp;:&nbsp;
            <span>{loction.state.money}</span>
          </div>
        </div>
      </div>
    </div>
  )
}

export default Looklist